docs: Expand GtkAccessible documentation
authorMatthias Clasen <mclasen@redhat.com>
Mon, 27 Jul 2020 02:39:17 +0000 (22:39 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 27 Jul 2020 02:39:47 +0000 (22:39 -0400)
Add some hints and examples.

gtk/gtkaccessible.c

index 2621361d07cfdc316e1948139bc76bb3ed3a4a06..850077b46839b114082d2b125cc3a6b5eeeceafc 100644 (file)
@@ -109,10 +109,19 @@ gtk_accessible_get_accessible_role (GtkAccessible *self)
  * @first_state: the first #GtkAccessibleState
  * @...: a list of state and value pairs, terminated by -1
  *
- * Updates a list of accessible states.
+ * Updates a list of accessible states. See the #GtkAccessibleState
+ * documentation for the value types of accessible states.
  *
  * This function should be called by #GtkWidget types whenever an accessible
  * state change must be communicated to assistive technologies.
+ *
+ * Example:
+ * |[
+ *   value = GTK_ACCESSIBLE_TRISTATE_MIXED;
+ *   gtk_accessible_update_state (GTK_ACCESSIBLE (check_button),
+ *                                GTK_ACCESSIBLE_STATE_CHECKED, value,
+ *                                -1);
+ * ]|
  */
 void
 gtk_accessible_update_state (GtkAccessible      *self,
@@ -195,10 +204,19 @@ gtk_accessible_update_state_value (GtkAccessible      *self,
  * @first_property: the first #GtkAccessibleProperty
  * @...: a list of property and value pairs, terminated by -1
  *
- * Updates a list of accessible properties.
+ * Updates a list of accessible properties. See the #GtkAccessibleProperty
+ * documentation for the value types of accessible properties.
  *
  * This function should be called by #GtkWidget types whenever an accessible
  * property change must be communicated to assistive technologies.
+ *
+ * Example:
+ * |[
+ *   value = gtk_adjustment_get_value (adjustment);
+ *   gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button),
+                                     GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value,
+                                     -1);
+ * ]|
  */
 void
 gtk_accessible_update_property (GtkAccessible         *self,